import 'package:flutter_dva/flutter_dva.dart';
import 'package:flutter_ui/src/states/system-state.dart';

class SystemModel implements Model<SystemStateTmpl> {
  @override
  Map<String, EffectFunction> effects = <String, EffectFunction>{
    "bootstrap": (Action action, ModelEffects modelEffects) async {
      
    },
  };

  @override
  String namespace = "system";

  @override
  Map<String, ReducerFuction> reducers = <String, ReducerFuction>{
    "save": (StoreOfState<dynamic> lastState, Action action) {
      lastState.setState(action.payload);
      return lastState;
    }
  };

  @override
  StoreOfState<SystemStateTmpl> state = StoreOfState<SystemStateTmpl>(state: SystemStateTmpl(), updateAt: DateTime.now());
}